package com.java.laixiangdong.express.bean;

import java.io.Serializable;
import java.util.Objects;

/**
 * 快递类
 */
public class Express implements Serializable {
    private int odd; // 单号
    private int code; // 取件码
    private String company; // 快递公司

    public Express() {
    }

    public Express(int odd, int code, String company) {
        this.odd = odd;
        this.code = code;
        this.company = company;
    }

    public int getOdd() {
        return odd;
    }

    public void setOdd(int odd) {
        this.odd = odd;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    @Override
    public String toString() {
        return "快递单号:" + odd + "\t" +
                "取件码:" + code + "\t" +
                "快递公司:" + company;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Express express = (Express) o;
        return getOdd() == express.getOdd();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getOdd());
    }
}
